package com.biz.primus.base.elasticsearch.entities;

import lombok.Getter;
import lombok.Setter;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.*;
import org.springframework.data.elasticsearch.core.geo.GeoPoint;

import java.io.Serializable;

/**
 * DepotEntity
 *
 * @author JKLiues
 * @date 2017/10/31
 */
@Getter
@Setter
@Document(indexName = "bbc_depots", type = "depot", refreshInterval = "3s")
public class DepotEntity implements Serializable {


    private static final long serialVersionUID = 2174826628188607063L;
    /**
     * ID
     */
    @Id
    @Field(type = FieldType.Long, index = FieldIndex.not_analyzed, store = true)
    private Long id;

    /**
     * 门店编号
     */
    @Field(type = FieldType.String, index = FieldIndex.not_analyzed, store = true)
    private String depotCode;


    /**
     * 名称
     */
    @Field(type = FieldType.String, store = true, analyzer = "ik", searchAnalyzer = "ik_smart")
    private String name;

    /**
     * 详细地址
     */
    @Field(type = FieldType.String, store = true, analyzer = "ik", searchAnalyzer = "ik_smart")
    private String address;

    /**
     * 省ID
     */
    @Field(type = FieldType.Long, index = FieldIndex.not_analyzed, store = true)
    private Long provinceId;

    /**
     * 市ID
     */
    @Field(type = FieldType.Long, index = FieldIndex.not_analyzed, store = true)
    private Long cityId;

    /**
     * 区ID
     */
    @Field(type = FieldType.Long, index = FieldIndex.not_analyzed, store = true)
    private Long districtId;

    /**
     * 门店类型
     */
    @Field(type = FieldType.Integer, index = FieldIndex.not_analyzed)
    private Integer depotType;

    /**
     * Geo 坐标
     */
    @GeoPointField
    private GeoPoint geoPoint;


    /**
     * 1开业   0歇业
     */
    @Field(type = FieldType.Integer, index = FieldIndex.not_analyzed, store = true)
    private Integer bizStatus;

    /**
     * 索引最后更新时间
     */
    @Field(type = FieldType.Long, index = FieldIndex.not_analyzed, store = true)
    private Long lastUpdateTime;
}
